package com.example.myapplication2;

import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.viewpager.widget.PagerTabStrip;
import androidx.viewpager.widget.ViewPager;
import com.example.myapplication2.Adapter.ViewPagerDemo3;

import java.util.ArrayList;
import java.util.HashMap;

public class Pager2Activity extends AppCompatActivity {
    public static final String[] array = {"Q", "A", "B","AAA","DDDDD"};
    public static final int[] ioc = {R.color.purple_200,R.color.black, R.color.teal_700, R.color.purple_200, R.color.teal_700};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pager2);
        ViewPager pagerTabStrip_10 = findViewById(R.id.PagerTabStrip_10);
        ArrayList<HashMap<String, Object>> list = new ArrayList<>();

        for (int i = 0; i < array.length; i++) {
            HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put("ioc", ioc[i]);
            hashMap.put("text", array[i]);
            list.add(hashMap);
        }
        ViewPagerDemo3 viewPagerDemo3 = new ViewPagerDemo3(this, list);
        pagerTabStrip_10.setAdapter(viewPagerDemo3);
    }
}